AI Tumor Segmentation
AI Tumor Segmentation - RKSP Docs
Files:
- Notebookf157a68854
Issues:
- A lot of commented code with definitions of functions commented
- Brain-tumor-detection-using-image-segmentation
Issues:
- The trained model segments brain tissues (according to cursor) and not tumor specific.
- Binary accuracy is not defined right and hence edited.
Common issues:
- Could not figure out how the numpy arrays are made and to be used exactly.
-  Cursor context:
Summary: Brain Tumor Segmentation Project - Issues and Fixes
Initial Code Problems: The original notebook suffered from a critical model collapse issue where the Dice coefficient dropped to 0.0000 after the first epoch and remained there for all 30 epochs, while binary accuracy froze at 0.6288. This was caused by a severely underpowered architecture (just 3 convolutional layers with no encoder-decoder structure), plain BCE loss that couldn't handle the extreme class imbalance (~63% background vs ~37% tumor regions), and poor weight initialization. The model essentially learned to predict the majority class (all background or all tumor) for every pixel, resulting in zero segmentation capability despite decreasing loss values.
Why It's Segmenting Outlines/Tissues Instead of Tumors: The fundamental issue is that we're using **synthetic masks** generated via Otsu thresholding and morphological operations, not real tumor annotations from radiologists. These synthetic masks simply identify bright/high-intensity regions in MRI scans, which could be any tissue boundaries, edges, contrast-enhanced areas, or anatomical structures - not necessarily tumors. The model is actually working correctly and achieving good Dice scores (0.79), but it's learning to segment "whatever the synthetic masks show" rather than actual pathological tumor regions. This is why the predictions highlight tissue outlines and bright regions instead of clinical tumor boundaries.
Path Forward: To achieve real tumor segmentation, you need ground truth masks annotated by medical professionals or use established datasets like BraTS (Brain Tumor Segmentation Challenge) that contain expert-validated tumor delineations. The current model demonstrates that the architecture and training pipeline work well - it successfully learns to match the patterns in the training data. However, those patterns are based on image intensity thresholding rather than medical pathology, so the model has learned to be an excellent "bright region detector" rather than a "tumor detector." The Dice score of 0.79 indicates the model is highly capable; it just needs proper medical annotations to learn what actual tumors look like.